<?php

// no direct access
defined('_JEXEC') or die('Restricted access');

// loading of the Joomla! basic controller
require_once (JPATH_COMPONENT . DS . 'controller.php');

JTable::addIncludePath(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_server' . DS . 'tables');

// loading  controller
if ($controller = JRequest::getWord('controller')) {
    $path = JPATH_COMPONENT . DS . 'controllers' . DS . $controller . '.php';
    if (file_exists($path)) {
        require_once $path;
    } else {
        $controller = '';
    }
}

// produce an object of the class controllers
$classname = 'ServerController' . ucfirst($controller);
$controller = new $classname();

// reading the request task
$controller->execute(JRequest::getCmd('task'));

// redirect from the controller
$controller->redirect();

?>